package com.sca.base.service.impl;

import cn.hutool.json.JSONUtil;
import com.mask.common.core.model.R;
import com.mask.common.log.util.LogUtils;
import com.sca.base.service.entity.User;
import com.sca.base.service.mapper.UserMapper;
import com.sca.base.api.service.RpcHelloService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @Author：jian
 * @Package：com.mask.service.base.impl
 * @Project：mask-sca-cloud
 * @name：HelloServiceImpl
 * @Date：2025/3/5 17:26
 * @Filename：HelloServiceImpl
 */

@DubboService
public class HelloServiceImpl implements RpcHelloService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public R<String> sysHello() {
//        LogUtils.info("测试日志输出");
        List<User> users = userMapper.selectList(null);
        String jsonStr = JSONUtil.toJsonStr(users);
//        System.err.println(jsonStr);
        return R.ok("1234567890");
    }
}
